/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Model;
import java.util.*;
import AirLine.*;
import edu.chl.chalmers.fatclient.sb.Flight;
import java.sql.*;
/**
 *
 * @author oskar
 */
public class DijkstraTester {
    ArrayList<Airport> airports;
    ArrayList<Flight> flights;
    Timestamp currentTime=new Timestamp(System.currentTimeMillis());
    TripHandler th;
    long hour=1000*60*60;
    
    
    public static void main(String args[])
    {
       new DijkstraTester();
        
    }
    
    public DijkstraTester()
    {
//        try {
            Airport from = new Airport("Helsinki", "1");
            Airport to = new Airport("America", "2");
            Airport middle1 = new Airport("Arlanda", "3");
            Airport middle2 = new Airport("Landvetter", "4");
            Airport norway=new Airport("Norway", "5");
//            Airports apDB = new Airports();
//            Set apFromDB = apDB.getAirportsList();
            airports = new ArrayList<Airport>();
            
            //airports.add(new Airport("kalle3", "12"));
            airports.add(from);
            airports.add(to);
            airports.add(middle1);
            airports.add(middle2);
            airports.add(norway);
            
            flights = new ArrayList<Flight>();
            
            
            /*
            flights.add(new Flight("number1", from, middle1, 25, currentTime, new Timestamp(currentTime.getTime()+3*hour), new TreeSet<Seat>(), "airline1"));
            flights.add(new Flight("number2", from, to, 25, currentTime, new Timestamp(currentTime.getTime()+41*hour), new TreeSet<Seat>(), "airline1"));
            flights.add(new Flight("number3", from, norway, 25, currentTime, new Timestamp(currentTime.getTime()+1*hour), new TreeSet<Seat>(), "airline1"));
            flights.add(new Flight("number4", middle1, middle2, 25, new Timestamp(currentTime.getTime()+7*hour), new Timestamp(currentTime.getTime()+8*hour), new TreeSet<Seat>(), "airline1"));
            flights.add(new Flight("number5", from, middle2, 25, currentTime, new Timestamp(currentTime.getTime()+3*hour), new TreeSet<Seat>(), "airline1"));
            flights.add(new Flight("number6", middle2, to, 25, new Timestamp(currentTime.getTime()+10*hour), new Timestamp(currentTime.getTime()+11*hour), new TreeSet<Seat>(), "airline1"));
            flights.add(new Flight("number7", norway, to, 25, new Timestamp(currentTime.getTime()+3*hour), new Timestamp(currentTime.getTime()+5*hour), new TreeSet<Seat>(), "airline1"));
            flights.add(new Flight("number8", middle1, to, 25, new Timestamp(currentTime.getTime()+4*hour), new Timestamp(currentTime.getTime()+8*hour), new TreeSet<Seat>(), "airline1"));
           */
            //th = new TripHandler();
            
            //flights.add(new Flight("number8", middle1, to, 25, new Timestamp(currentTime.getTime()+4*hour), new Timestamp(currentTime.getTime()+8*hour), new TreeSet<Seat>(), "airline1"));
            //th.setAirports(airports);
            //th.setFlights(flights);
//            th.setParameters(from, to, 3, 1, new Timestamp(currentTime.getTime()-10000));
            TreeSet<Trip> ts = null;
            try{
            ts=th.getTrips();
            }catch(Exception e){}
            for(Trip t: ts)
            {
                System.out.println(t);
            }
    }
   
}
